#include "CUnit.h"

CUnit::CUnit(): maArea(NULL), fSpeedX(0), fSpeedY(0), iPower(0){}

CUnit::CUnit(CMath* inMaArea, float inFSpeedX, float inFSpeedY, int inIPower, vector<ALLEGRO_BITMAP*>::const_iterator begin, 
	vector<ALLEGRO_BITMAP*>::const_iterator end, CPoint inMaCoordinate): maArea(NULL), fSpeedX(inFSpeedX), fSpeedY(inFSpeedY), iPower(inIPower),  
	CElement(begin, end, inMaCoordinate){
	SetMaArea(inMaArea);
}
CUnit::CUnit(const CUnit &inCUnit):maArea(NULL), fSpeedX(inCUnit.fSpeedX), fSpeedY(inCUnit.fSpeedY), iPower(inCUnit.iPower), 
	CElement(inCUnit){
		SetMaArea(inCUnit.maArea);
}

CUnit& CUnit::operator=(const CUnit& inCUnit){
	if(this != &inCUnit){
		SetMaArea(inCUnit.maArea);
		fSpeedX = inCUnit.fSpeedX;
		fSpeedY = inCUnit.fSpeedY;
		iPower = inCUnit.iPower;
		CElement::operator=(inCUnit);
	}
	return *this;
}

CUnit::~CUnit(){
	delete maArea;
}

CMath* CUnit::GetMaArea(){
	return maArea;
}

void CUnit::SetMaArea(const CMath* inMaArea){
	delete maArea;
	maArea = new CMath(*inMaArea);
}

float CUnit::GetFSpeedX(){
	return fSpeedX;
}

void CUnit::SetFSpeedX(float inFSpeedX){
	fSpeedX = inFSpeedX;
}

float CUnit::GetFSpeedY(){
	return fSpeedY;
}

void CUnit::SetFSpeedY(float inFSpeedY){
	fSpeedY = inFSpeedY;
}

int CUnit::GetIPower(){
	return iPower;
}

void CUnit::SetIPower(int inIPower){
	iPower = inIPower;
}



